#ifndef __baker_Occluder_h__
#define __baker_Occluder_h__

#include "Prerequire.h"
#include "Vector.h"
#include "Ray.h"

namespace baker
{
    class HitState;

    /** The interface of Occluders for shadow casting.
    */
    class IOccluder
    {
    public:

        IOccluder() {}

        virtual ~IOccluder() {}

        /** Append a vertex to this occluder.
        */
        virtual void addVertex( const Vec3 & vec3 ) = 0;

        /** Append a face (Triangle) to this occluder.
            The face is defined by the 3 indices to vertex
        */
        virtual void addFace( guint v0
                            , guint v1
                            , guint v2
                            ) = 0;

        /** Inform this occluder to build the internal data structures for intersection-test.
            After build() is called, this occluder will become immutable; and any data added by
            addVertex() and addFace() may be lost.
        */
        virtual void build() = 0;

        /** Fast hit test. No intersection data will be returned.
            @return true if the ray has hit any face inside this occluder; otherwise, false.
        */
        virtual bool hitTestFast( const Ray3 & ray ) = 0;

        /** Peform hit test and reterive
            @param hitState A HitState object to retrieve the HitInfo.
            @param ray The Ray3 to perform the intersect test.
        */
        virtual void hitTestFull( HitState & hitState
                                , const Ray3 & ray
                                ) = 0;

    };
}

#endif  // __baker_Occluder_h__
